package com.stx.crazy.service.impl;

import com.stx.crazy.dao.UserDao;
import com.stx.crazy.entity.User;
import com.stx.crazy.service.UserService;

public class UserServiceImpl implements UserService {

	private UserDao dao;
	private User user;

	public UserDao getDao() {
		return dao;
	}

	public void setDao(UserDao dao) {
		this.dao = dao;
	}


	@Override
	public void addUser(User user) throws Exception {
		dao.insertUser(user);
	}

	@Override
	public User getUserByLoginNameAndPassword(String us_loginName, String us_passWord)
			throws Exception {
		User user = dao.getUserByLoginNameAndPassword(us_loginName, us_passWord);
		return user;
	}

	@Override
	public void deleteUser(String us_id) {
		// TODO 自动生成的方法存根

	}

	@Override
	
	public void updateUser(User user) {
		dao.update(user);
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
